package com.example.demo2.service.impl;

import com.example.demo2.entity.YTTest;
import com.example.demo2.mapper.DemoMapper;
import com.example.demo2.service.TestService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author jie
 * @date 2019/10/29 -14:22
 */
@Service
@Transactional
public class TestServiceImpl implements TestService {

    @Resource
    private DemoMapper demoMapper;

    @Override
    public List<YTTest> findAll() {
        return demoMapper.findAll();
    }

    @Override
    public int del() {
        demoMapper.del(2);
        demoMapper.del(3);
        return 1;
    }

    @Override
    public int add(YTTest ytTest) {
        return demoMapper.addTest(ytTest);
    }
}
